#ifndef _MySQLClient_H
#define _MySQLClient_H

#include <mysql/mysql.h>

#include <string>
#include <vector>
using std::string;
using std::vector;

class MySQLClient
{
public:
    MySQLClient();
    ~MySQLClient();
    bool connect(const string & host,
                 unsigned short port,
                 const string & user,
                 const string & passwd,
                 const string & db);
    bool writeOperationQuery(const string & sql);
    vector<vector<string>> readOperationQuery(const string & sql);

    static void dump(const vector<vector<string>> & res);

private:
    void init();

private:
    MYSQL _conn;
};

#endif

